package flags

import (
	"fmt"
	"muziai-server/global"
	"muziai-server/models"
)

func AutoMigrate() {
	err := global.DB.AutoMigrate(
		&models.UserModel{},
		&models.AiRoleModel{},
		&models.SessionModel{},
		&models.ChatModel{},
		&models.ImageModel{},
		&models.ChatToImageModel{},
		&models.OrderModel{},
		&models.LogModel{},
		&models.UserLoginModel{},
		&models.AiRoleWorkOrderModel{},
	)
	if err != nil {
		fmt.Printf("表结构迁移失败 %s \n", err)
	} else {
		fmt.Println("表结构迁移成功！")
	}
}
